<template>
  <div class="w-full h-full bg-gray-200">
    <slot>
      <div v-for="(item, index) in userNav" :key="index">
        <router-link :to="item.path" class="flex items-center p-2">
          <el-icon>
            <component :is="item.icon"></component>
          </el-icon>
          <span class="ml-2">{{ item.name }}</span>
        </router-link>
      </div>
    </slot>
  </div>
</template>

<script setup>
import { defineProps, ref, reactive } from "vue";

// 定义props
const props = defineProps({
  userNav: Array // 假设 userNav 是一个数组
});

// 定义变量
const userNav = ref(props.userNav);
</script>

<style lang="scss" scoped></style>
